package com.netflexitysolutions.amazonws.sdb.internal.iterators;

import java.util.List;

import com.amazonaws.sdb.doc._2009_04_15.ListDomains;
import com.netflexitysolutions.amazonws.sdb.Domain;
import com.netflexitysolutions.amazonws.sdb.ResponseCallback;
import com.netflexitysolutions.amazonws.sdb.SimpleDB;
import com.netflexitysolutions.amazonws.sdb.internal.operations.ListDomainsOperation;
import com.netflexitysolutions.amazonws.sdb.internal.operations.OperationExecutor;

public class DomainListIterator extends AbstractListIterator<ListDomains, Domain> {
	
	/**
	 * @param simpleDB
	 * @param callback
	 */
	public DomainListIterator(SimpleDB simpleDB, ResponseCallback callback){
		super(simpleDB, callback);
	}
	
	/* (non-Javadoc)
	 * @see com.netflexitysolutions.amazonws.sdb.internal.iterators.AbstractListIterator#prepareOperation()
	 */
	@Override
	public OperationExecutor<ListDomains, List<Domain>> prepareOperation() {
		return new ListDomainsOperation(getSimpleDB(), (getCallback().getMaxRecords() == null ? ResponseCallback.MAX_NUMBER_OF_DOMAINS : getCallback().getMaxRecords()), getCallback().getNextToken());
	}
}
